package model;

import java.io.File;

import view.CacheListener;
import view.ServerListener;
import model.cache.CacheController;
import model.server.Server;

public class MainModel {
	private Server server;

	private CacheController cacheController;

	public static String applicationRoot = new File(".").getAbsolutePath();

	public MainModel() {
		cacheController = new CacheController();
		cacheController.start();
		server = new Server(cacheController);
		server.start();
	}

	public void addServerListener(ServerListener listener) {
		server.addObserver(listener);
	}

	public void addCacheListener(CacheListener listener) {
		cacheController.addObserver(listener);
	}
}
